import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
// swiper 轮播图
// import Swiper from 'swiper'
// import 'swiper/css/swiper.css'
// css
import '@/styles/index.less'
// element
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// 简单header 添加 id 后期可以更改单独文件
const request = axios.create({
  baseURL: '/',
  timeout: 5000
})
request.interceptors.request.use(config => {
  config.headers['client-id'] = `${store.state.id}`
  config.headers.token = `${store.state.token}`
  return config
}, error => {
  return Promise.reject(error)
})

export default request
// -----------------------------------------------
Vue.use(ElementUI)
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
// 18306039510
